﻿namespace UnityEditor
{
    using System;
    using UnityEngine;

    [CustomEditor(typeof(MeshRenderer)), CanEditMultipleObjects]
    internal class MeshRendererEditor : Editor
    {
        private SerializedProperty m_LightProbeAnchor;
        private SerializedProperty m_UseLightProbes;

        public void OnEnable()
        {
            this.m_UseLightProbes = base.serializedObject.FindProperty("m_UseLightProbes");
            this.m_LightProbeAnchor = base.serializedObject.FindProperty("m_LightProbeAnchor");
        }

        public override void OnInspectorGUI()
        {
            base.serializedObject.Update();
            EditorGUIUtility.LookLikeInspector();
            string[] propertyToExclude = new string[] { "m_UseLightProbes", "m_LightProbeAnchor" };
            Editor.DrawPropertiesExcluding(base.serializedObject, propertyToExclude);
            EditorGUILayout.PropertyField(this.m_UseLightProbes, new GUILayoutOption[0]);
            if (this.m_UseLightProbes.boolValue)
            {
                EditorGUI.indentLevel++;
                EditorGUILayout.PropertyField(this.m_LightProbeAnchor, new GUIContent("Anchor Override", this.m_LightProbeAnchor.tooltip), new GUILayoutOption[0]);
                EditorGUI.indentLevel--;
            }
            base.serializedObject.ApplyModifiedProperties();
        }
    }
}

